<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>驾驶员行为分析报告</title>
    <script>
        var cssFileLoadArr = ['/content/css/sub/driverBehaviorReport.css'];
    </script>
    <jsp:include flush="true" page="../../base/base.jsp"></jsp:include>

    <script type="text/html" id="temp">
        <div class="top-info">
            <h3>驾驶员行为分析报告</h3>

            <div class="report-info">
                <span class="driver"></span>
                <label class="label-text">姓名：</label>
                <span class="span-text">{{scoreSortVo && scoreSortVo.drvName}}</span>
                <span class="score"></span>
                <label class="label-text">考核评分：</label>
                <span class="span-text">{{scoreSortVo && scoreSortVo.score}} 环比 {{scoreSortVo && scoreSortVo.scoreGth}}分 {{if scoreSortVo && scoreSortVo.scoreGth >0}}↑{{/if}}{{if scoreSortVo && scoreSortVo.scoreGth <0}}↓{{/if}}</span>
                <span class="degree"></span>
                <label class="label-text">等级：</label>
                <span class="span-text">{{scoreSortVo && scoreSortVo.scoreType}}</span>

            </div>
            <div class="report-info pt10">
                <span class="time"></span>
                <label class="label-text">时间范围：</label>
                <span class="span-text">{{timeRangeVo.rangeFrom}}~{{timeRangeVo.rangeTo}}</span>
            </div>
        </div>

        {{if featureTypeVos}}
        {{each featureTypeVos as featureType i}}
        <div class="detail-table-wrap">
            <h4>{{featureType.featureTypeDes}}</h4>
            <table class="table-style8" width="100%">
                <tbody>
                <tr>
                    <th width="290">驾驶行为</th>
                    <th width="98">评价</th>
                    <th width="98">严重度</th>
                    <th>改进建议</th>
                </tr>

                {{each featureType.featureDetailList as list i2}}
                <tr>
                    <td>{{list.featureDes}}</td>
                    {{if list.featureEvalT ==0}}
                    <td class="ac degree1">{{list.featureEval}}</td>
                    {{/if}}
                    {{if list.featureEvalT ==1}}
                    <td class="ac degree3">{{list.featureEval}}</td>
                    {{/if}}
                    {{if list.featureEvalT ==2}}
                    <td class="ac degree2">{{list.featureEval}}</td>
                    {{/if}}
                    <td class="ac">{{list.featureImpor}}</td>
                    <td>{{list.featureImpr}}</td>
                </tr>
                {{/each}}


                </tbody>
            </table>
        </div>
        {{/each}}
        {{/if}}

    </script>
</head>
<body>
<div class="table-wrap driver-behavior-table pb20" id="content" style="top:0;">

</div>
<script type="text/javascript">

    $(function () {
        require(['template.min'], function () {
            var search = window.location.search;
            if (search) {
                var arr = search.replace('?', '').split('&');
                var param = {};
                $.each(arr, function (i, item) {
                    param[item.split('=')[0]] = item.split('=')[1];
                });

                $.ajaxExt({
                    url: '/driverBehavior/getBehaviorReport.htm',
                    data: param,
                    success: function (data) {
                        console.log(data);
                        if (data) {

                            $('#content').append(template('temp', data));
                        }
                    }
                })
            }
        });

    });
</script>
</body>
</html>